import { CloudRequest } from '../utils/cloud-request.js'
class IndexModel extends CloudRequest {
  
  /**
   * 获取首页轮播
   * @param {*} callBack 
   */
  getBanner(callBack) {
    this.request({
      url: "getBanner",
      success: res => {
        callBack(res)
      }
    })
  }
  
  /**
   * 获取主题 
   * @param {*} callBack 
   */
  getTheme(callBack){
    this.request({
      url: "getTheme",
      success: res => {
        callBack(res)
      }
    })
  }

  /**
   * 获取摘要列表数据
   * @param callBack
   * @2021-1-7 16:15:13
   */
  getAbstract(options,callBack){
    this.request({
      url: "getAbstract",
      data:options,
      success: res => {
        callBack(res)
      }
    })
  }
  /**
   * 获取用户信息
   * @param callBack
   * 2021-1-7 16:15:17
   */
  getUserInfo(callBack){
    this.request({
      url:"getUserInfo",
      success: res => {
        callBack(res)
      }
    })
  }
  /**
   * 获取用户详细信息
   * @param callBack
   * 2021-1-7 16:15:17
   */
  getUserInfoMore(options,callBack){
    this.request({
      url:"getUserInfoMore",
      data:options,
      success: res => {
        callBack(res)
      }
    })
  }
  /**
   * 新增用户信息
   * @param callBack
   * 2021-1-7 16:15:17
   */
  addUser(options,callBack){
    this.request({
      url:"addUser",
      data:options,
      success: res => {
        callBack(res)
      }
    })
  }
  /**
   * 查询用户信息
   * @param callBack
   * 2021-1-7 16:15:17
   */
  getUser(options,callBack){
    this.request({
      url:"getUser",
      data:options,
      success: res => {
        callBack(res)
      }
    })
  }
  /**
   * 修改用户信息
   * @param callBack
   * 2021-1-7 16:15:17
   */
  updateUser(options,callBack){
    this.request({
      url:"updateUser",
      data:options,
      success: res => {
        callBack(res)
      }
    })
  }

  /**
   * 获取最新商品
   * @param {*} callBack 
   */
  getProductNew(callBack){
    this.request({
      url: "getProductNew",
      success: res => {
        callBack(res)
      }
    })
  }

}

export { IndexModel }